/*
 * @Author: Vorga
 * @LastEditors: Vorga
 */
#ifndef HUFFMAN_TREE_H
#define HUFFMAN_TREE_H

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>

#include "tree_node.h"
#include "heap_tree.h"

typedef struct HuffmanCode {
    char code;
    uint64_t bits;
    int cnt;
}HuffmanCode;

typedef struct Data {
    //huffman编码的集合
    uint64_t bits;
    //位数
    int cnt;
}Data;

TreeNode* create_huffman_t();

void set_weight_file_huffman_t(char* path);

void code_huffman_t(TreeNode* node, int bits, int len);

void zip_file(char* inpath, char* outpath);

void unzip_file(char* inpath, char* outpath);

#endif // HUFFMAN_TREE_H
